// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'
import Client from '@api/base/api/DeviceDetailApi'

import OneClass from '@api/base/model/QueryDeviceDetailReq'

const CLIENT = CORE.grpcCLIENT(Client)

// ============================== 导出远程接口 ============================== //

export default {
  // —————————————————————————————— 单项 —————————————————————————————— //

  async getOne(one, TIP = '查询设备详情') {
    const DTO = CORE.grpcDTO(OneClass, one)
    const { content = [] } = await CORE.grpc(TIP, CLIENT, 'queryDetailDevice', DTO)
    return content[0] || one
  },
}
